<!DOCTYPE html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>个人中心</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">

<include file="./Public/public/public.html" />
    <script>
        $(document).ready(function(){
            $("input[type='hidden'][contenteditable]").contenteditable();
            $(".select2").select2({
                width: '100%',
                minimumResultsForSearch: Infinity
            });

            $("select[name='dep_type']").on("change",function(){
                if($(this).val()){
                    var option = $(this).find("option[value="+$(this).val()+"]");
                    var userName = $(option).attr('username');
                    var cardId = $(option).attr('cardid');
                    var subbankname = $(option).attr('subbankname');
                    var bankid = $(option).attr('bankid');
                    $("[name='withdraw[user_name]']").val(userName);
                    $("[name='dep_cardno']").val(cardId);
                    $("[name='withdraw[sub_bank_name]']").val(subbankname);
                    $("[name='withdraw[bank_id]']").val(bankid);
                }else{
                    $("[name='withdraw[user_name]']").val("");
                    $("[name='dep_cardno']").val("");
                    $("[name='withdraw[sub_bank_name]']").val("");
                    $("[name='withdraw[bank_id]']").val("");
                }
            });
        })

        function clcAmount(){
            var amount = $("[name='dep_money']").val();
            var tax = amount*$("#rate").val();
            var bonus = $("[name='user_packet']").find("option:selected").attr('amount')-0;
            var arrival = 0;
            if(tax>= bonus){
                arrival = amount - tax + bonus;
                tax = tax-bonus;
            }else{
                arrival = amount;
                tax = 0;
            }
            $("#tax").html("￥"+new Number(tax).toFixed(2));
            $("#arrival").html("￥"+new Number(arrival).toFixed(2));
            $("#dep_fee").val(tax);
            $("#actual_money").val(arrival);
            $("#dep_coupon").val(bonus);
        }

        function withdraw(){
            Qsubmit($('#withdrawForm'),function(msg){
                showModal({msg:msg});
                setTimeout("jumpFlowWithdraw()", 3000 );
            });
        }

        function jumpFlowWithdraw(){
            window.location = "{:U('Depositlog/index')}";
        }

    </script>

</head>
<body>
<!--pc头部-->
<include file="./Public/public/top.html" />
<!--pc头部结束-->
<div class="layout-wrap">
    <!--已审核-->
    <div class="layout">
	     <include file="./Public/public/centerLeft.html" />
	    <div class="right" ms-controller="right" style="min-height: 882px;">
	    <h3><a class="button-xs button-blue mr10" href="flowWithdraw">返回</a>申请提现</h3>

        <div class="cnt-tips">
            <p>
            温馨提示：遵守国家反洗钱和套现行为的相关法律规定：充值后的所有资金交易后才能提现。<br>如有提现抵用券每次限使用一张。单笔提现金额需是100的倍数，小于等于50万 <br>
            每个工作日16:30之前的提现 当天支付 
            </p>
        </div>
        <div class="split-dot mt10 mb10"></div>
        <form action="{:U('Depositlog/saveDeposit')}" method="post" id="withdrawForm">
            <div class="form-inner">
                <div class="form-row form-row-s">
                    <div class="input-name w30">提现方式</div>
                    <div class="input-box w65">
                        <select name="dep_type" valid="{'required':true}" msg="{'required':'提现方式必须选择'}">
                            <option value="" username="" cardid="">请选择银行卡</option>
                            <volist name="bankList" id="vo">
                            	<option value="1" username="{$vo.username}" cardid="{$vo.bankcode}" subbankname="{$vo.bankname}" bankid="{$vo.id}">{$vo.bankname}</option>                        
							</volist>
                        </select>
                    </div>
                    <div class="clr"></div>
                </div>
                <div class="form-row form-row-s">
                    <div class="input-name w30">收款人</div>
                    <div class="input-box w35">
                    	<input class="input-s" placeholder="" name="withdraw[user_name]" type="text">
                    </div>
                    <div class="input-name-even w30">
                    </div>
                    <div class="clr"></div>
                </div>
                <div class="form-row form-row-s">
                    <div class="input-name w30">收款账号</div>
                    <div class="input-box w65">
                    	<input class="input-s" placeholder="收款账号与收款人不同则无法收款" name="dep_cardno" readonly="" type="text">
                    <div class="clr"></div>
                </div>
                <div class="form-row form-row-s">
                    <div class="input-name w30">可提现金额</div>
                    <div class="input-name-even w60"><a>￥{$userAssets.present_money}</a></div>
                    <div class="clr"></div>
                </div>
                <div class="form-row form-row-s">
                    <div class="input-name w30">提现金额</div>
                    <div class="input-box w35">
                    	<input class="input-s" placeholder="" name="dep_money" onkeyup="clcAmount()" 
                    	maxlength="7" valid="{'required':true,'number':true,'regex':'/^[0-9]+00$/g','maxLength':7,'numberRange':[50,500000]}" 
                    	msg="{'required':'金额必须填写','number':'必须是整数','regex':'提现金额需是100的倍数',
                    	'maxLength':'输入字符长度不能超过7位','numberRange':'提现金额不能低于50，超出50万请分多笔提现或联系客服'}" 
                    	type="text">
                    </div>
                    <div class="clr"></div>
                </div>
                <div class="form-row form-row-s">
                    <div class="input-name w30">提现手续费</div>
                    <input  name="dep_fee" type="hidden"  id="dep_fee">
                    <div class="input-name-even w20">
                    	<a id="tax">￥0.00</a>
                    </div>
                    <div class="clr"></div>
                </div>
                <div class="form-row form-row-s">
                    <div class="input-name w30">实际到账金额</div>
                    <input  name="actual_money" type="hidden"  id="actual_money">
                    <div class="input-name-even w60">
                    	<a id="arrival">￥0.00</a>
                    </div>
                    <div class="clr"></div>
                </div>
                <div class="form-row form-row-s">
                    <div class="input-name w30">用户备注</div>
                    <div class="input-box w65">
                        <textarea class="textarea" name="userremark"></textarea>
                    </div>
                    <div class="clr"></div>
                </div>
            </div>
            <div class="split-dot text-center mb10"></div>
            <div class="form-inner">
                <div class="form-row form-row-s">
                    <div class="input-name w30">交易密码</div>
                    <div class="input-box w35">
                        <input name="transpasswd" valid="{'required':true}" msg="{'required':'请填写交易密码'}" class="input-s" 
                        autocomplete="off" type="password">
                    </div>
                    <div class="input-name-even w30">
                    	<a href="{:U('User/pwd')}">设置密码?</a>
                    </div>
                    <div class="clr"></div>
                </div>
            </div>
            <div class="form-inner">
                 <input  id="ischeck" type="hidden" value="2">
                 <input type="hidden" id="sendMobileUrl" value="{:U('HomeBase/sendMobileMes')}" />
                <div class="form-row form-row-s">
                    <div class="input-name w30">短信验证码</div>
                    <div class="input-box w35">
                        <input id="codeMobile" name="codeMobile" 
                        valid="{'required':true,'number':true,'limitLength':6}" 
                        msg="{'required':'请填写6位数字验证码','number':'请填写6位数字验证码','limitLength':'请填写6位数字验证码'}" 
                        class="input-s" placeholder="6位数字验证码" type="tel">
                    </div>
                    <input type="hidden"  id="mobile"  value="{$mobile}">
                    <div class="input-name-even w35" style="padding-left: 10px">
                    <div id="sendMObileMess" watch="mobile" 
						method="mobile" emsg="请输入正确的手机号"
						token="12ad2b693c60403ad9169f6c5f4bc042" left="0"
						class="timer w100 fl">手机获取</div>
                    </div>
                    <div class="clr"></div>
                </div>
            </div>
            <div class="split-dot mt10 mb10 text-center"></div>
            <div class="inner">
                <div class="form-row form-row-s">
                    <input action="confirm" class=" button button-orange fl" style="width:200px" value="确认" onclick="withdraw()" type="button">
                    <div class="clr"></div>
                </div>
            </div>
        </form>
    	</div>
	    <div class="clr"></div>
	    <div class="clr"></div>
    </div>
</div>
<include file="./Public/public/footer.html" />
<script type="text/javascript" src="{$app_path}{$static_path}/js/common.js"></script>
</body></html>